package com.telit.dispose.controller.dispose;

import com.telit.common.entity.DataReturn;
import com.telit.dispose.entity.dispose.PlatMetaFieldEntity;
import com.telit.dispose.service.dispose.PlatMetaFieldService;
import com.telit.dispose.service.dispose.PlatMetaTableService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * Create by Chencf 2022/08/04
 */

@Deprecated
@RestController
//@RequestMapping("/plat/meta/field/")
//@Api(tags = "desc = 元数据字段接口")
public class PlatMetaFieldController {

    @Autowired
    private PlatMetaFieldService platMetaFieldService;

    @Autowired
    private PlatMetaTableService platMetaTableService;


    private static final String[] PRIMARY_FIELD_CODE = new String[]{
            "id", "code", "name", "delete_flag", "create_by", "create_name",
            "create_date", "update_by", "update_name", "update_date",
            "tentment_id"
    };


    @PostMapping("add")
    @ApiOperation("添加元数据字段")
    public DataReturn addPlatMetaField(PlatMetaFieldEntity entity) {
        boolean b = platMetaFieldService.addPlatMetaField(entity);
        return DataReturn.ok();
    }


    @PostMapping("create")
    @ApiOperation("创建元数据字段")
    public DataReturn createPlatMetaField(String id) {
        boolean b = platMetaFieldService.createPlatMetaField(id);
        return DataReturn.ok();
    }

//
//    @PostMapping("create")
//    @ApiOperation("创建元数据字段")
//    public boolean updatePlatMetaFieldById(PlatMetaFieldEntity entity) {
//        boolean b = platMetaFieldService.updatePlatMetaFieldById(entity);
//
//        return false;
//    }

}
